package com.weixin.paleituo.fragment;

import android.content.Context;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.weixin.paleituo.R;
import com.weixin.paleituo.adapter.MyBelowRecyclerViewAdapter;
import com.weixin.paleituo.base.BaseFragment;
import com.weixin.paleituo.util.UIUtils;

/**
 * Author yichao
 * Time  2017/12/18 15:25
 * Dest  全名经纪人我的下级
 */

public class BrokerageMyLowberFragment extends BaseFragment {

    private RecyclerView mRecyclerView;
    private MyBelowRecyclerViewAdapter mAdapter;

    @Override
    public View initView(Context context) {

        View contentView = UIUtils.inflate(context, R.layout.fragment_brokerage_mybelow);

        mRecyclerView = contentView.findViewById(R.id.recycle_mybelow_fragment_brokerage_mybelow);
        return contentView;
    }

    @Override
    protected void initData() {
        super.initData();
        mAdapter = new MyBelowRecyclerViewAdapter(mContext);
        //设置布局管理器
        mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        //设置adapter
        mRecyclerView.setAdapter(mAdapter);
        //设置Item增加、移除动画
        mRecyclerView.setItemAnimator(new DefaultItemAnimator());
        //添加分割线
        mRecyclerView.addItemDecoration(new DividerItemDecoration(
                mContext, DividerItemDecoration.VERTICAL));
    }
}
